package com.yhy.wxzn.wms.core;

import com.yhy.wxzn.common.utils.SpringUtil;
import com.yhy.wxzn.wcs.device.rgv.bean.Coord;
import com.yhy.wxzn.wcs.device.rgv.bean.Lifter;
import com.yhy.wxzn.wcs.device.rgv.bean.Node;
import com.yhy.wxzn.wcs.entity.WcsMapInfo;
import com.yhy.wxzn.wcs.service.impl.WcsMapInfoServiceImpl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

public class WmsGoodsAllocator {

    private static final WcsMapInfoServiceImpl mapInfoService = SpringUtil.getBean(WcsMapInfoServiceImpl.class);




    public static synchronized Coord allocateInPortGood(String itemId){
        List<Node> nodes = mapInfoService.getNodes(mapInfoService.list());
        HashMap<Node,Node> map= new HashMap(Math.max((int) (nodes.size()/.75f) + 1, 16));
        nodes.forEach(m->map.put(m,m));


        Map<Integer, List<Node>> floorMap = nodes.stream().collect(Collectors.groupingBy(node -> node.getZ()));



        floorMap.entrySet();


        /**
         * 1.
         */



        return null;
    }




    public static synchronized List<Coord> allocateOutPortGoods(String itemId){


        return null;
    }
}
